<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <div id="app">
        <h1 ref="qqq" v-for=' i in ary'>{{name}}{{i}}</h1>
    </div>
</body>
</html>
<script src="../node_modules/vue/dist/vue.js"></script>
<script>
    let vm = new Vue({
        el:'#app',
        data:{
            name:"珠峰",
            ary:[1,2,3,4]
        },
        mounted() {
          // vue 的DOM 更新时 一个异步操作
          console.log(this.$refs.qqq)
          this.ary.push(5,6);
          console.log(this.$refs.qqq)
          // $nextTick 接受一个回调函数 该回调函数会在下一次DOM更新完成之后触发
          this.$nextTick(()=>{
            console.log(this.$refs.qqq)
          })
        },
    });
</script>